import Main from '@/views/Main.vue';

// 不作为Main组件的子页面展示的页面单独写，如下
export const loginRouter = {
    path: '/login',
    name: 'login',
    meta: {
        title: 'Login - 登录'
    },
    component: resolve => require(['@/views/login.vue'], resolve)
};

export const loginRouterSecond = {
    path: '/loginSecond',
    name: 'loginSecond',
    meta: {
        title: 'Login - 登录'
    },
    component: resolve => require(['@/views/uam/login/login2.vue'], resolve)
};

// export const page404 = {
//     path: '/*',
//     name: 'error-404',
//     meta: {
//         title: '404-页面不存在'
//     },
//     component: resolve => require(['@/views/error-page/404.vue'], resolve)
// };

export const page403 = {
    path: '/403',
    meta: {
        title: '403-权限不足'
    },
    name: 'error-403',
    component: resolve => require(['@//views/error-page/403.vue'], resolve)
};

export const page500 = {
    path: '/500',
    meta: {
        title: '500-服务端错误'
    },
    name: 'error-500',
    component: resolve => require(['@/views/error-page/500.vue'], resolve)
};

export const preview = {
    path: '/preview',
    name: 'preview',
    component: resolve => require(['@/views/form/article-publish/preview.vue'], resolve)
};

export const locking = {
    path: '/locking',
    name: 'locking',
    component: resolve => require(['@/views/main-components/lockscreen/components/locking-page.vue'], resolve)
};

// 作为Main组件的子页面展示但是不在左侧菜单显示的路由写在otherRouter里
export const otherRouter = {
    path: '/',
    name: 'otherRouter',
    redirect: '/home',
    component: Main,
    children: [
        { path: 'home', title: {i18n: 'home'}, name: 'home_index', component: resolve => require(['@/views/home/home.vue'], resolve) },
        { path: 'ownspace', title: '个人中心', name: 'ownspace_index', component: resolve => require(['@/views/own-space/own-space.vue'], resolve) },
        { path: 'order/:order_id', title: '订单详情', name: 'order-info', component: resolve => require(['@/views/advanced-router/component/order-info.vue'], resolve) }, // 用于展示动态路由
        { path: 'shopping', title: '购物详情', name: 'shopping', component: resolve => require(['@/views/advanced-router/component/shopping-info.vue'], resolve) }, // 用于展示带参路由
        { path: 'message', title: '消息中心', name: 'message_index', component: resolve => require(['@/views/message/message.vue'], resolve) }
    ]
};

// 作为Main组件的子页面展示并且在左侧菜单显示的路由写在appRouter里
export const appRouter = [
    // {
    //     path: '/api-manage',
    //     icon: 'ios-grid-view',
    //     name: 'api-manage',
    //     title: 'api网关',
    //     component: Main,
    //     children: [
    //         { path: 'serviceProvicer', title: '服务方管理', name: 'provider', icon: 'arrow-move', component: resolve => require(['@/views/api-manage/provider.vue'], resolve)},
    //         { path: 'requester', title: '请求方管理', name: 'requester', icon: 'edit',  component: resolve => require(['@/views/api-manage/requester.vue'], resolve) },
    //         { path: 'interfaceManage', title: '接口管理', name: 'serviceInfo', icon: 'edit', component: resolve => require(['@/views/api-manage/serviceInfo.vue'], resolve) },
    //         { path: 'serReqAssociation', title: '关联管理', name: 'serReqAssociation', icon: 'edit',  component: resolve => require(['@/views/api-manage/serReqAssociation.vue'], resolve) },
    //         { path: 'invokLog', title: '调用日志', name: 'invokLog', icon: 'edit', component: resolve => require(['@/views/api-manage/invokLog.vue'], resolve) },
    //         { path: 'operationLog', title: '操作日志', name: 'operationLog', icon: 'edit',  component: resolve => require(['@/views/api-manage/operationLog.vue'], resolve) },
    //         { path: 'logStatistics', title: '日志统计', name: 'logStatistics', icon: 'edit',  component: resolve => require(['@/views/api-manage/logStatistics.vue'], resolve) },
    //         { path: 'accessControl', title: '访问控制', name: 'accessControl', icon: 'edit',  component: resolve => require(['@/views/api-manage/accesscontrol.vue'], resolve) },
    //         { path: 'interfaceFlow', title: '接口流量统计', name: 'interfaceFlow', icon: 'edit',  component: resolve => require(['@/views/api-manage/interfaceFlow.vue'], resolve) },
    //         { path: 'serviceApiMonitor', title: '接口流量监控统计', name: 'serviceApiMonitor', icon: 'edit',  component: resolve => require(['@/views/api-manage/serviceApiMonitor.vue'], resolve) },
    //         { path: 'serviceFrequencyMonitoring', title: '服务频率监控', name: 'serviceFrequencyMonitoring', icon: 'edit',  component: resolve => require(['@/views/api-manage/serviceFrequencyMonitoring.vue'], resolve) },
    //         { path: 'serviceQualityMonitoring', title: '服务质量统计', name: 'serviceQualityMonitoring', icon: 'edit',  component: resolve => require(['@/views/api-manage/serviceQualityMonitoring.vue'], resolve) },
    //         { path: 'providerServiceMonitor', title: '提供者服务器监控', name: 'providerServiceMonitor', icon: 'edit',  component: resolve => require(['@/views/api-manage/providerServiceMonitor.vue'], resolve) },
    //     ]
    // },
    // {
    //     path: '/app-market-dataBase',
    //     icon: 'ios-grid-view',
    //     title: '市场管理',
    //     name: 'app-market',
    //     component: Main,
    //     children: [
    //         { path: 'market', title: '应用市场', name: 'market', icon: 'search', component: resolve => require(['@/views/api-manage/requester.vue'], resolve) },
    //         { path: 'applicationType', title: '应用分类', name: 'application-type', icon: 'search', component: resolve => require(['@/views/api-manage/requester.vue'], resolve) },
    //         { path: 'supplier', title: '开发者管理', name: 'supplier', icon: 'search', component: resolve => require(['@/views/api-manage/requester.vue'], resolve) },
    //         { path: 'app-authorization', icon: 'compose', name: 'appauthorization',  title: '应用授权', component: resolve => require(['@/views/api-manage/requester.vue'], resolve)}
    //     ]
    // },
    // {
    //     path: '/app-market-manage',
    //     icon: 'key',
    //     name: 'appMarket',
    //     title: '应用管理',
    //     component: Main,
    //     children: [
    //         {
    //             path: 'app-summary',
    //             icon: 'compose',
    //             name: 'appsummary',
    //             title: '应用管理',
    //             component: resolve => require(['@/views/app-market/app-list/app-summary.vue'], resolve)
    //         },
    //         {
    //             path: 'app-summary22',
    //             icon: 'compose',
    //             name: 'appsummary22',
    //             title: '应用管理Test',
    //             component: resolve => require(['@/views/app-market/app-list/app-summary-test.vue'], resolve)
    //         },
    //         {
    //             path: 'app-summary-add',
    //             icon: 'compose',
    //             name: 'appsummaryAdd',
    //             title: '新增应用',
    //             component: resolve => require(['@/views/app-market/app-list/app-summary-add.vue'], resolve)
    //         },
    //         {
    //             path: 'app-verify-public',
    //             icon: 'compose',
    //             name: 'appverifypublic',
    //             title: '应用发布管理',
    //             component: resolve => require(['@/views/app-market/app-list/app-verify-public.vue'], resolve)
    //         },
    //         {
    //             path: 'app-verify-update',
    //             icon: 'compose',
    //             name: 'appverifyupdate',
    //             title: '应用更新审核',
    //             component: resolve => require(['@/views/app-market/app-list/app-verify-update.vue'], resolve)
    //         }
    //     ]
    // },
    // {
    //     path: '/applicationAudit',
    //     icon: 'key',
    //     name: 'applicationAudit',
    //     title: '应用审核',
    //     component: Main,
    //     children: [
    //         { path: 'applicationAudit2', title: '应用审核', name: 'applicationAudit2', icon: 'link', component: resolve => require(['@/views/application-audit/applicationAudit.vue'], resolve) },
    //     ]
    // },
    // {
    //     path: '/uam',
    //     icon: 'key',
    //     name: 'uam',
    //     title: '系统管理',
    //     component: Main,
    //     children: [
    //         { path: 'user', title: '用户管理', name: 'user', icon: 'link', component: resolve => require(['@/views/uam/user/user.vue'], resolve) },
    //         { path: 'role', title: '角色管理', name: 'role', icon: 'link', component: resolve => require(['@/views/uam/role/role.vue'], resolve) },
    //         { path: 'organization', title: '部门管理', name: 'organization', icon: 'link', component: resolve => require(['@/views/uam/organization/organization.vue'], resolve) },
    //         { path: 'dictionary', title: '字典管理', name: 'dictionary', icon: 'link',component: resolve => require(['@/views/uam/dictionary/dictionary.vue'], resolve) },
    //         // { path: 'jobCategory', title: '警种管理', name: 'jobCategory', icon: 'link', component: resolve => require(['@/views/uam/job-category/job-category.vue'], resolve) },
    //         // { path: 'test-uam', title: 'test-uam', name: 'test-uam', icon: 'link', component: resolve => require(['@/views/uam/test/test.vue'], resolve)},
    //         // { path: 'login22', title: 'login22', name: 'login22', icon: 'edit', component: resolve => require(['@/views/uam/login/login2.vue'], resolve) },
    //     ]
    // },
    // {/*基础管理后台版*/
    //     path: '/fuwuServer',
    //     icon: 'key',
    //     name: 'fuwuServer',
    //     title: '基础管理',
    //     component: Main,
    //     children: [
    //         { path: 'organizationBace', title: '资源信息管理', name: 'organizationBace', icon: 'link', component: resolve => require(['@/views/oragion-info/oragionInfo.vue'], resolve) },
    //         { path: 'yuanData', title: '元数据管理', name: 'yuanData', icon: 'link', component: resolve => require(['@/views/fuwuServer/yuanData/yuanData.vue'], resolve) },
    //         { path: 'dataOrigin', title: '数据源管理', name: 'dataOrigin', icon: 'link', component: resolve => require(['@/views/fuwuServer/dataOrigin/dataOrigin.vue'], resolve) },
    //     ]
    // },
    // {/*服务资源管理后台版*/
    //     path: '/serverResource',
    //     icon: 'key',
    //     name: 'serverResource',
    //     title: '服务资源管理',
    //     component: Main,
    //     children: [
    //         { path: 'serverRegister', title: '服务资源注册', name: 'serverRegister', icon: 'link', component: resolve => require(['@/views/serverResource/serverRegister/serverRegister.vue'], resolve) },
    //         { path: 'shareServer', title: '共享服务发布', name: 'shareServer', icon: 'link', component: resolve => require(['@/views/serverResource/shareServer/shareServer.vue'], resolve)},
    //         { path: 'collectServer', title: '采集服务发布', name: 'collectServer', icon: 'link', component: resolve => require(['@/views/serverResource/collectServer/collectServer.vue'], resolve) },
    //     ]
    // },
    // {/*区域资源目录*/
    //     path: '/areaResource',
    //     icon: 'key',
    //     name: 'areaResource',
    //     title: '区域资源管理',
    //     component: Main,
    //     children: [
    //         { path: 'areaAbout', title: '区域概述', name: 'areaAbout', icon: 'link', component: resolve => require(['@/views/areaResource/areaAbout.vue'], resolve)},
    //         { path: 'areaManage', title: '区域管理', name: 'areaManage', icon: 'link', component: resolve => require(['@/views/areaResource/areaManage.vue'], resolve)},
    //         { path: 'tongdaoManage', title: '通道管理', name: 'tongdaoManage', icon: 'link', component: resolve => require(['@/views/areaResource/tongdaoManage.vue'], resolve)},
    //         { path: 'shareServerRi', title: '共享服务日志', name: 'shareServerRi', icon: 'link', component: resolve => require(['@/views/areaResource/shareServerRi.vue'], resolve)},
    //         { path: 'collectServerRi', title: '采集服务日志', name: 'collectServerRi', icon: 'link', component: resolve => require(['@/views/areaResource/collectServerRi.vue'], resolve)},
    //     ]
    // },
    // {/*智能资源目录*/
    //     path: '/smartResource',/*首次在这个项目使用路由懒加载，原因是这个项目太大，很多东西没有优化，打开实在太慢*/
    //     icon: 'key',
    //     name: 'smartResource',
    //     title: '智能资源管理',
    //     component: Main,
    //     children: [
    //         { path: 'smartResourceManage', title: '智能资源管理', name: 'smartResourceManage', icon: 'link', component: resolve => require(['@/views/smartResource/smartResourceManage/smartResourceManage.vue'], resolve)},
    //         { path: 'alertRi', title: '告警日志', name: 'alertRi', icon: 'link', component: resolve => require(['@/views/smartResource/alertRi/alertRi.vue'], resolve)},
    //         { path: 'serviceChore', title: '服务编排', name: 'serviceChore', icon: 'link', component: resolve => require(['@/views/smartResource/serviceChore/serviceChore.vue'], resolve)},
    //     ]
    // },
    // {/*统计监控*/
    //     path: '/statisticalMonitoring',
    //     icon: "key",
    //     name: "statisticalMonitoring",
    //     title: "统计监控",
    //     component: Main,
    //     children: [
    //         { path: 'sharedClass', title: '数据共享类统计', name: 'sharedClass', icon: 'link', component: resolve => require(['@/views/statisticalMonitoring/sharedClass/sharedClass.vue'], resolve)},
    //         { path: 'collectionClass', title: '采集共享类统计', name: 'collectionClass', icon: 'link', component: resolve => require(['@/views/statisticalMonitoring/collectionClass/collectionClass.vue'], resolve)},
    //     ]
    // },
    // {/*服务资源目录*/
    //     path: '/serverList',
    //     icon: 'key',
    //     name: 'serverList',
    //     title: '服务资源目录',
    //     component: Main,
    //     children: [
    //         { path: 'serverList2', title: '服务资源目录', name: 'serverList2', icon: 'link', component: resolve => require(['@/views/server-list/fuwulist.vue'], resolve)},
            
    //     ]
    // },
    // {/*服务管理平台字典*/
    //     path: '/smDictionaryController',
    //     icon: 'key',
    //     name: 'smDictionaryController',
    //     title: '服务管理平台字典',
    //     component: Main,
    //     children: [
    //         { path: 'smDictionaryController2', title: '服务管理平台字典', name: 'smDictionaryController2', icon: 'link', component: resolve => require(['@/views/sm-dictionary-controller/smDictionaryController.vue'], resolve)},
            
    //     ]
    // },
];

// 所有上面定义的路由都要写在下面的routers里
export const routers = [
    loginRouter,
    loginRouterSecond,
    otherRouter,
    preview,
    locking,
    ...appRouter,
    page500,
    page403,
    // page404,
];
